from fractions import Fraction

max_res = 0
max_limit = Fraction(3,7)
for d in range(1,10**6):
    for n in range(int(3/7*d)-1,int(3/7*d)+1):
        llv = Fraction(n, d)
        if max_limit > llv > max_res:
            max_res = llv
            print(max_res)

print(max_res)